with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings;
with System;
with SDL_stdinc_h;

package SDL_joystick_h is


  SDL_HAT_CENTERED : constant := 16#00#;  --  SDL_joystick.h:128
  SDL_HAT_UP : constant := 16#01#;  --  SDL_joystick.h:129
  SDL_HAT_RIGHT : constant := 16#02#;  --  SDL_joystick.h:130
  SDL_HAT_DOWN : constant := 16#04#;  --  SDL_joystick.h:131
  SDL_HAT_LEFT : constant := 16#08#;  --  SDL_joystick.h:132
  --  unsupported macro: SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP)
  --  unsupported macro: SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN)
  --  unsupported macro: SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP)
  --  unsupported macro: SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN)

  --    SDL - Simple DirectMedia Layer
  --    Copyright (C) 1997-2006 Sam Lantinga
  --    This library is free software; you can redistribute it and/or
  --    modify it under the terms of the GNU Lesser General Public
  --    License as published by the Free Software Foundation; either
  --    version 2.1 of the License, or (at your option) any later version.
  --    This library is distributed in the hope that it will be useful,
  --    but WITHOUT ANY WARRANTY; without even the implied warranty of
  --    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  --    Lesser General Public License for more details.
  --    You should have received a copy of the GNU Lesser General Public
  --    License along with this library; if not, write to the Free Software
  --    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  --    Sam Lantinga
  --    slouken@libsdl.org
  -- 

  -- Include file for SDL joystick event handling  
  -- Set up for C function definitions, even when using C++  
  -- In order to use these functions, SDL_Init() must have been called
  --   with the SDL_INIT_JOYSTICK flag.  This causes SDL to scan the system
  --   for joysticks, and load appropriate drivers.
  -- 

  -- The joystick structure used to identify an SDL joystick  
   --  skipped empty struct u_SDL_Joystick

   --  skipped empty struct SDL_Joystick

  -- Function prototypes  
  -- * Count the number of joysticks attached to the system
  --  

   function SDL_NumJoysticks return int;  -- SDL_joystick.h:51:50
   pragma Import (C, SDL_NumJoysticks, "SDL_NumJoysticks");

  -- * Get the implementation dependent name of a joystick.
  -- * This can be called before any joysticks are opened.
  -- * If no name can be found, this function returns NULL.
  --  

   function SDL_JoystickName (device_index : int) return Interfaces.C.Strings.chars_ptr;  -- SDL_joystick.h:58:71
   pragma Import (C, SDL_JoystickName, "SDL_JoystickName");

  -- * Open a joystick for use - the index passed as an argument refers to
  -- * the N'th joystick on the system.  This index is the value which will
  -- * identify this joystick in future joystick events.
  -- *
  -- * This function returns a joystick identifier, or NULL if an error occurred.
  --  

   function SDL_JoystickOpen (device_index : int) return System.Address;  -- SDL_joystick.h:67:73
   pragma Import (C, SDL_JoystickOpen, "SDL_JoystickOpen");

  -- * Returns 1 if the joystick has been opened, or 0 if it has not.
  --  

   function SDL_JoystickOpened (device_index : int) return int;  -- SDL_joystick.h:72:64
   pragma Import (C, SDL_JoystickOpened, "SDL_JoystickOpened");

  -- * Get the device index of an opened joystick.
  --  

   function SDL_JoystickIndex (joystick : System.Address) return int;  -- SDL_joystick.h:77:69
   pragma Import (C, SDL_JoystickIndex, "SDL_JoystickIndex");

  -- * Get the number of general axis controls on a joystick
  --  

   function SDL_JoystickNumAxes (joystick : System.Address) return int;  -- SDL_joystick.h:82:71
   pragma Import (C, SDL_JoystickNumAxes, "SDL_JoystickNumAxes");

  -- * Get the number of trackballs on a joystick
  -- * Joystick trackballs have only relative motion events associated
  -- * with them and their state cannot be polled.
  --  

   function SDL_JoystickNumBalls (joystick : System.Address) return int;  -- SDL_joystick.h:89:72
   pragma Import (C, SDL_JoystickNumBalls, "SDL_JoystickNumBalls");

  -- * Get the number of POV hats on a joystick
  --  

   function SDL_JoystickNumHats (joystick : System.Address) return int;  -- SDL_joystick.h:94:71
   pragma Import (C, SDL_JoystickNumHats, "SDL_JoystickNumHats");

  -- * Get the number of buttons on a joystick
  --  

   function SDL_JoystickNumButtons (joystick : System.Address) return int;  -- SDL_joystick.h:99:74
   pragma Import (C, SDL_JoystickNumButtons, "SDL_JoystickNumButtons");

  -- * Update the current state of the open joysticks.
  -- * This is called automatically by the event loop if any joystick
  -- * events are enabled.
  --  

   procedure SDL_JoystickUpdate;  -- SDL_joystick.h:106:53
   pragma Import (C, SDL_JoystickUpdate, "SDL_JoystickUpdate");

  -- * Enable/disable joystick event polling.
  -- * If joystick events are disabled, you must call SDL_JoystickUpdate()
  -- * yourself and check the state of the joystick when you want joystick
  -- * information.
  -- * The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE.
  --  

   function SDL_JoystickEventState (state : int) return int;  -- SDL_joystick.h:115:61
   pragma Import (C, SDL_JoystickEventState, "SDL_JoystickEventState");

  -- * Get the current state of an axis control on a joystick
  -- * The state is a value ranging from -32768 to 32767.
  -- * The axis indices start at index 0.
  --  

   function SDL_JoystickGetAxis (joystick : System.Address; axis : int) return SDL_stdinc_h.Sint16;  -- SDL_joystick.h:122:84
   pragma Import (C, SDL_JoystickGetAxis, "SDL_JoystickGetAxis");

  -- * Get the current state of a POV hat on a joystick
  -- * The return value is one of the following positions:
  --  

  -- * The hat indices start at index 0.
  --  

   function SDL_JoystickGetHat (joystick : System.Address; hat : int) return SDL_stdinc_h.Uint8;  -- SDL_joystick.h:140:81
   pragma Import (C, SDL_JoystickGetHat, "SDL_JoystickGetHat");

  -- * Get the ball axis change since the last poll
  -- * This returns 0, or -1 if you passed it invalid parameters.
  -- * The ball indices start at index 0.
  --  

   function SDL_JoystickGetBall
     (joystick : System.Address;
      ball : int;
      dx : access int;
      dy : access int) return int;  -- SDL_joystick.h:147:99
   pragma Import (C, SDL_JoystickGetBall, "SDL_JoystickGetBall");

  -- * Get the current state of a button on a joystick
  -- * The button indices start at index 0.
  --  

   function SDL_JoystickGetButton (joystick : System.Address; button : int) return SDL_stdinc_h.Uint8;  -- SDL_joystick.h:153:87
   pragma Import (C, SDL_JoystickGetButton, "SDL_JoystickGetButton");

  -- * Close a joystick previously opened with SDL_JoystickOpen()
  --  

   procedure SDL_JoystickClose (joystick : System.Address);  -- SDL_joystick.h:158:70
   pragma Import (C, SDL_JoystickClose, "SDL_JoystickClose");

  -- Ends C function definitions when using C++  
end SDL_joystick_h;
